package com.e3.basdoc.corp.client;

import java.util.List;

import com.e3.basdoc.corp.model.CorpModel;
import com.e3.basdoc.corp.model.CorpQC;
import com.e3.web.core.client.RPCServiceHelper;
import com.e3.web.core.client.WebException;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;

public interface CorpRPCService extends RemoteService {

	public static class Util {

		private static CorpRPCServiceAsync instance;

		public static CorpRPCServiceAsync getInstance() {
			instance = (CorpRPCServiceAsync) RPCServiceHelper.getService(CorpRPCService.class.getName());
			if (instance == null) {
				instance = GWT.create(CorpRPCService.class);
				RPCServiceHelper.registerServiceEntryPoint(instance);
			}
			return instance;
		}

	}

	CorpModel newCorp(CorpModel corpModel) throws WebException;

	List<CorpModel> getCorpsByCondition(CorpQC corpQC) throws WebException;

	CorpModel modifyCorp(CorpModel corpModel) throws WebException;

	void deleteCorps(List<CorpModel> corpModels) throws WebException;

	List<CorpModel> getCorpChildren(CorpModel corpModel) throws WebException;

	CorpModel getCorpById(String id) throws WebException;

}
